//
//  ENSharesTableHeaderView.m
//  EverydayNews
//
//  Created by 李沛池 on 2017/8/6.
//  Copyright © 2017年 Godlike. All rights reserved.
//

#import "ENSharesTableHeaderView.h"

@interface ENSharesTableHeaderView ()

@property (weak, nonatomic) IBOutlet UIButton *btnDiffRate;
@property (weak, nonatomic) IBOutlet UIImageView *iViewArrow;

@end

@implementation ENSharesTableHeaderView

- (void)updateData:(NSNumber *)currentSortUP
{
    BOOL isUP = [currentSortUP boolValue];
    if (isUP) {
        _iViewArrow.transform = CGAffineTransformMakeRotation(0);
        [UIView animateWithDuration:1 animations:^{
            _iViewArrow.transform = CGAffineTransformMakeRotation(M_PI);
        }];
    }else {
        _iViewArrow.transform = CGAffineTransformMakeRotation(M_PI);
        [UIView animateWithDuration:1 animations:^{
            _iViewArrow.transform = CGAffineTransformMakeRotation(0);
        }];
    }
}

- (IBAction)changeShow:(UIButton *)sender
{
    static BOOL isUp = YES;
    if (_changeShowBlock) {
        _changeShowBlock(isUp);
        if (isUp) {
            isUp = NO;
        }else {
            isUp = YES;
        }
    }
}


@end
